<template>
	<view>
        <uni-nav-bar id="nav" class="u-f-ajc" :height="modelType == 'pad'?54:44" :statusBar="true" :fixed="true">
            <view slot="left"  style="width: 50px;" @click="backAction()">
                <uni-icons type="back" size="25"></uni-icons>
            </view>
            <view class="" style="width: 100%;" :style="{lineHeight: (modelType == 'pad'?54:44)+'px'}">
                <template>
                    <view class="u-f-r u-f-ac u-f-ajc top-title" style="width: 100%;">
                        <view class="navTitle" style="font-weight: 500">小峰管家</view>
                    </view>
                </template>
            </view>
        </uni-nav-bar>
		<!-- 开通成功 -->
		<order-success :title="$t('JLink.paySuccess.successfullyOpened')" ></order-success>
		<voesOrPms v-if="classifyId==='xmc.voes' || classifyId==='pms.voes' || classifyId==='pms.sms'" :classifyId="classifyId" :urlParams="urlParams">
			<template #default>
				<view class="text-primary text-right margin-lr">
					<text @tap="handleLearnMore" class="text-sm">
						{{$t('JLink.paySuccess.voesOrPms.learnMore')}}<text class="lg text-gray cuIcon-right" style="font-size:26rpx"></text>
					</text>
				</view>
			</template>
		</voesOrPms>
		<view class="cu-bar tabbar foot" style="box-shadow: none;height:calc(140rpx + env(safe-area-inset-bottom) / 2)!important">
			<success-button style="width: 100%;"></success-button>
		</view>
	</view>
	
</template>

<script>
  import constants from '@/utils/constants.js'
  import orderSuccess from "../../components/uni-success/index.vue"
  import voesOrPms from './module/voesOrPms.vue'
  import successButton from './module/buttons.vue'
  import orderStatus from "@/jvss/pageCloud/utils/pay"

  const { GROUPTYPE } = constants
  const { handleClear } = orderStatus();

  export default {
    components: {
      orderSuccess,
      voesOrPms,
      successButton
    },
    props:{

    },
    data() {
      return {
        urlParams:{},
        classifyId:'',
        isShow:{
          devState:false,//设备是否离线
        },
          modelType: null,
      }
    },
    onLoad(opt) {
      const {channel,tradeNo,classifyId} = opt;
      this.classifyId = classifyId;
      this.urlParams = {
        chnId:channel,
        devId:tradeNo
      }
	  console.log('了解更多===1',opt);
    },
      onReady() {
          uni.getSystemInfo({
              success: (res) => {
                  console.log('系统信息', res);
                  this.modelType = res.deviceType;
              }
          })
      },
    onUnload() {
      handleClear()
    },
    methods: {
      handleLearnMore () {
		  console.log('了解更多===',GROUPTYPE(),this.classifyId);
        GROUPTYPE().forEach(z=>{
          if(this.classifyId===z.classifyId){
			this.$routing(`${this.$pages.introduce}${z.icon}?classifyId=${this.classifyId}`)
            // uni.navigateTo({
            //   url: `/jvss/pages/service/introduce/${z.icon}?classifyId=${this.classifyId}`
            // });
          }
        })
      },
        backAction() {
          uni.switchTab({
              url: '/jvss/pages/cloud/cloud'
          })
        },
    }
  }
</script>
<style lang="less" scope>
@import '@/common/style/main.css';
.top-title {
    font-size: 14px;
}
</style>
